package com.ytjj.qmyx.admin.controller;

import com.ytjj.common.api.CommonResult;
import com.ytjj.qmyx.admin.annotation.OperLog;
import com.ytjj.qmyx.admin.constants.SysLogConstants;
import com.ytjj.qmyx.admin.service.SelectCommentService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 *
 * 
 * @Version: 1.0
 *
 * 选品审核模块--评论
 */
@RestController
@RequestMapping("/selectComment")
public class SelectCommentController {

	@Resource
	private SelectCommentService selectCommentService;

	@GetMapping("/list")
	@OperLog(operModule = "选品审核评论模块", operDesc = "评论列表", operType = SysLogConstants.OPERATION_SELECT)
	public CommonResult selectList(@RequestParam Integer selectExamId) {
		return CommonResult.success(selectCommentService.selectList(selectExamId));
	}

	@GetMapping("/insert")
	@OperLog(operModule = "选品审核评论模块", operDesc = "新增评论", operType = SysLogConstants.OPERATION_ADD)
	public CommonResult insertComment(@RequestParam Integer selectExamId, @RequestParam String content) {
		return CommonResult.success(selectCommentService.insertComment(selectExamId, content));
	}

}
